package Presenter;
import java.text.DecimalFormat;

import Model.Player;
import Model.Planet.Planet;
import View.PlayerInfoView;

public class PlayerInfoPresenter {
	/**
	 * 
	 */
	private final Player player = Player.getInstance();

	/**
	 * 
	 */
	private final DecimalFormat fmt = new DecimalFormat("0.00");
	
	/** 
	 * A getter for the player info view
	 * @return a new instance of the player info view
	 */
	public PlayerInfoView getView(){
		return new PlayerInfoView();
	}
	
	/**
	 * A getter for the player's name
	 * @return the players name
	 */
	public String getPlayerName(){
		return player.getName();
	}
	
	/**
	 * A getter for the player's ship name
	 * @return the player's ship name
	 */
	public String getPlayerShipName(){
		if(player.getShip() != null){
			if(player.getShip().getName() != null){
				return player.getShip().getName();
			}
			
		}
		
		return "name not selected";
	}
	
	/**
	 * A getter for the current fuel on the ship
	 * @return the current fuel
	 */
	public String getCurrentFuel(){
		return fmt.format(player.getShip().getFuel());
	}
	
	/**
	 * A getter for the player's credit
	 * @return the player's credit
	 */
	public String getPlayerCredits(){
	return "$" + fmt.format(player.getCredits());
	}
	
	/**
	 * A getter for the player's pilot level
	 * @return the player's pilot layer
	 */
	public int getPlayerPilotLevel(){
		return player.getPilotLevel();
	}
	
	/**
	 * A getter for the player's fighter level
	 * @return the player's fighter level
	 */
	public int getPlayerFighterLevel(){
		return player.getFighterLevel();
	}
	
	/**
	 * A getter for the player's trader level
	 * @return the player's trader level
	 */
	public int getPlayerTraderLevel(){
		return player.getTraderLevel();
	}
	
	/** 
	 * A getter for the player's trader level
	 * @return the players trader level
	 */
	public int getPlayerEngineerLevel(){
		return player.getEngineerLevel();
	}
	
	/**
	 * A getter for what current planet the player is on
	 * @return the current planet
	 */
	public Planet getCurrentPlanet(){
		return player.getCurrentPlanet();
	}
	
	public String toString(){
		return super.toString();
	}
}
